/**
 * 函数防抖
 * @param fn
 * @returns {function(...[*]=)}
 */

export default function (fn, time = 200) {
  let timer = null
  return (...args) => {
    clearTimeout(timer)
    timer = setTimeout(() => {
      fn(...args)
    }, time)
  }
}
